home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: May 2000
- //
- //
- //
- // Procedure Name:
- // artAttrToolScript
- //
- // Description:
- // create wrapper around the artSelect command
- //
- // Input Arguments:
- // 4 ==> enter the tool (create if necessary)
- // 3 ==> property sheet box
- //
- // Return Value:
- // None.
- //
- global proc string artAttrToolScript(
- int $setToTool,
- string $attrFilter
- )
- //
- // Description :
- // 4 ==> enter the tool
- {
- global string $gArtAttrFilterLabel;
- global string $gArtAttrCurrentAttr;
-
- $gArtAttrFilterLabel = "Filter: all";
- $gArtAttrCurrentAttr = "";
-
- string $tool = "artAttrContext";
- if ( $attrFilter == "" ) {
- // General Attribute Paint Tool.
- makePaintable -activateAll true;
- makePaintable -activate false "mesh" "vertexColorRGB" ;
- makePaintable -activate false "mesh" "vertexFaceColorRGB" ;
- makePaintable -activate false "skinCluster" "*";
- $gArtAttrFilterLabel = "Filter: all";
- }
- else if ( $attrFilter == "cluster" ) {
- // Cluster Paint Weight Tool.
- makePaintable -activateAll false;
- makePaintable -activate true "cluster" "weights";
-
- // Set the filter label.
- $gArtAttrFilterLabel = "Filter: cluster";
- }
- else if ( $attrFilter == "jiggle" ) {
- // Jiggle Paint Weight Tool.
- makePaintable -activateAll false;
- makePaintable -activate true "jiggle" "weights";
-
- // Set the filter label.
- $gArtAttrFilterLabel = "Filter: jiggle";
- }
- else if ( $attrFilter == "polyReduce" ) {
- // Poly Reduce Paint Weight Tool.
- makePaintable -activateAll false;
- makePaintable -activate true "polyReduce" "weights";
-
- // Set the filter label.
- $gArtAttrFilterLabel = "Filter: polyReduce";
- }
- else if ( $attrFilter == "particle" ) {
- // Soft Body Paint Tool.
- makePaintable -activateAll false;
- makePaintable -activate true "particle" "*";
-
- // Set the filter label.
- $gArtAttrFilterLabel = "Filter: particle";
- }
-
- // Create a tool if it does not exists.
- if( ! `artAttrCtx -exists $tool` ) {
- rememberCtxSettings `artAttrCtx -i1 "attrPaint.xpm" -whichTool "general" $tool`;
- }
- setToolTo $tool;
-
- if( 3 == $setToTool ) {
- toolPropertyWindow;
-
- // Make sure that the filer is displayed.
- if (`button -q -ex artAttrFilterButton`) {
- button -e -label $gArtAttrFilterLabel artAttrFilterButton;
- }
- }
- else {
- if( 4 != $setToTool ) {
- warning( "Wrong input for artAttrToolScript" );
- } else if (!artAttrInitPaintableAttr()) {
- warning("Select an object that has paintable attributes.");
- }
- }
- return $tool;
- }
-